package com.wswy.wyjk.api;


import com.my.httpapi.api.baseApi.BaseApi;

public class OldApi extends BaseApi {
    private volatile static OldApi instance;
    private ApiService service;

    private OldApi() {
        super(Constant.OLDURL, 10, 0, 11111111);
    }

    public static OldApi getInstance() {
        if (instance == null) {
            synchronized (OldApi.class) {
                if (instance == null) {
                    instance = new OldApi();
                }
            }
        }
        return instance;
    }

    public static ApiService getApi() {
        return getInstance().getDefault();
    }

    public void clearApiService() {
        if (service != null) service = null;
    }

    public ApiService getDefault() {
        return service == null ? service = getRetrofit().create(ApiService.class) : service;
    }

}
